#pragma once

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include <linux/list.h>

#include "types.h"

struct TIMER {
    struct hlist_node entry;
    unsigned long expires;  // 超时时间，取绝对时间，基于jiffies
    unsigned int flags;
    FIFO32Type *fifo;
    unsigned int data;
};

void timer_free(struct TIMER *timer);
void timer_init(struct TIMER *timer, FIFO32Type *fifo, unsigned int data);
void timer_settime(struct TIMER *timer, unsigned long timeout);

#ifdef __cplusplus
}
#endif /* __cplusplus */
